﻿using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VM.Entity.EntityMap.User;

namespace VM.Entity.EntityMap.Goods
{
    public class good_mainInfo
    {

        #region Model
        private int? _id;
        private int? _billstatus;
        private int? _goodstypeid;
        private string? _tilte;
        private int? _gooodsspecid;
        private int? _viewqty;
        private decimal? _price;
        private decimal? _lineprice;
        private int? _joinqty;
        private string? _linktel;
        private int? _stockqty;
        private string? _belongorg;
        private string? _description;
        private int? _createuserid;
        private DateTime? _createdate;
        private int? _updateuserid;
        private DateTime? _updatedate;

        private int? _istop;
        private int? _istuijian;
        private int? _isremen;
        private int? _ishomelunbo;
        private int? _ishuodonglunbo;
        private string? _startplace;
        private string? _endplace;
        private DateTime? _startdate;
        private DateTime? _enddate;


        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, IsOnlyIgnoreInsert = true)]
        [JsonIgnore]
        public int? id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 主图
        /// </summary>
        [Navigate(NavigateType.OneToMany,  nameof(good_headImgs.parentId),nameof(id))]
        [ForeignKey("parentId")]
        public List<good_headImgs>? headImgs { get; set; }

        /// <summary>
        /// 规格属性
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(good_spec.parentId), nameof(id))]
        [ForeignKey("parentId")]
        [JsonIgnore]
        public  List<good_spec>? goodSpec { get; set; }
        /// <summary>
        /// 单据状态
        /// </summary>
        [JsonIgnore]
        public int? billStatus
        {
            set { _billstatus = value; }
            get { return _billstatus; }
        }
        /// <summary>
        /// 类别内码
        /// </summary>
       
        public int? goodsTypeId
        {
            set { _goodstypeid = value; }
            get { return _goodstypeid; }
        }
        /// <summary>
        /// 标题
        /// </summary>
        public string? tilte
        {
            set { _tilte = value; }
            get { return _tilte; }
        }
        /// <summary>
        /// 规格属性内码
        /// </summary>
        public int? gooodsSpecId
        {
            set { _gooodsspecid = value; }
            get { return _gooodsspecid; }
        }
        /// <summary>
        /// 查看次数
        /// </summary>
        public int? viewQty
        {
            set { _viewqty = value; }
            get { return _viewqty; }
        }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal? price
        {
            set { _price = value; }
            get { return _price; }
        }
        /// <summary>
        /// 划线单价
        /// </summary>
        public decimal? linePrice
        {
            set { _lineprice = value; }
            get { return _lineprice; }
        }
        /// <summary>
        /// 参与次数
        /// </summary>
        public int? joinQty
        {
            set { _joinqty = value; }
            get { return _joinqty; }
        }
        /// <summary>
        /// 联系人
        /// </summary>
        public string? linkName { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string? linkTel
        {
            set { _linktel = value; }
            get { return _linktel; }
        }
        /// <summary>
        /// 库存数量
        /// </summary>
        public int? stockQty
        {
            set { _stockqty = value; }
            get { return _stockqty; }
        }
        /// <summary>
        /// 归属单位
        /// </summary>
        public string? belongOrg
        {
            set { _belongorg = value; }
            get { return _belongorg; }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string? description
        {
            set { _description = value; }
            get { return _description; }
        }

        /// <summary>
        /// 创建人
        /// </summary>
        public int? createUserId
        {
            set { _createuserid = value; }
            get { return _createuserid; }
        }

        /// <summary>
        /// 创建人信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(createUserId))]
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        [JsonIgnore]
        public sys_user createUser { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? createDate
        {
            set { _createdate = value; }
            get { return _createdate; }
        }
        /// <summary>
        /// 更新人
        /// </summary>
        public int? updateUserId
        {
            set { _updateuserid = value; }
            get { return _updateuserid; }
        }

        /// <summary>
        /// 更新人信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(updateUserId))]
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        [JsonIgnore]
        public sys_user updateUser { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? updateDate
        {
            set { _updatedate = value; }
            get { return _updatedate; }
        }

        /// <summary>
        /// 是否置顶
        /// </summary>
        public int? isTop
        {
            set { _istop = value; }
            get { return _istop; }
        }
        /// <summary>
        /// 是否推荐
        /// </summary>
        public int? isTuiJian
        {
            set { _istuijian = value; }
            get { return _istuijian; }
        }
        /// <summary>
        /// 是否热门
        /// </summary>
        public int? isReMen
        {
            set { _isremen = value; }
            get { return _isremen; }
        }
        /// <summary>
        /// 是否首页轮播
        /// </summary>
        public int? isHomeLunBo
        {
            set { _ishomelunbo = value; }
            get { return _ishomelunbo; }
        }
        /// <summary>
        /// 是否活动页轮播
        /// </summary>
        public int? isHuoDongLunBo
        {
            set { _ishuodonglunbo = value; }
            get { return _ishuodonglunbo; }
        }
        /// <summary>
        /// 出发地
        /// </summary>
        public string? startPlace
        {
            set { _startplace = value; }
            get { return _startplace; }
        }
        /// <summary>
        /// 目的地
        /// </summary>
        public string? endPlace
        {
            set { _endplace = value; }
            get { return _endplace; }
        }
        /// <summary>
        /// 活动开始时间
        /// </summary>
        public DateTime? startDate
        {
            set { _startdate = value; }
            get { return _startdate; }
        }
        /// <summary>
        /// 活动截止时间
        /// </summary>
        public DateTime? endDate
        {
            set { _enddate = value; }
            get { return _enddate; }
        }



        [Navigate(NavigateType.OneToOne, nameof(id), nameof(good_applyNotes.parentId))]
        [ForeignKey("parentId")]
        public good_applyNotes? applyNotes { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(id), nameof(good_contentInfo.parentId))]
        [ForeignKey("parentId")]
        public good_contentInfo? contentInfo { get; set; }
         
        #endregion Model
    }
}
